<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="asserts/css/content.css">
    <link rel="stylesheet" th:href="@{../../asserts/css/content.css}">
    <link rel="stylesheet" href="asserts/css/bootstrap.min.css">
    <link rel="stylesheet" th:href="@{../../asserts/css/bootstrap.min.css}">
</head>
<body>
<div>
    <form method="post" th:action="@{/awa/query}">
        <table class="table table-striped table-sm">
            <thead>
            <tr>
                <td style="font-size: large">输入名称查询：</td>
                <td>
                    <input type="text"  class="form-control col-form-label-sm"  th:value="${query} == null ?'三好学生' : ${query}" name="name">
                </td>
                <td>
                    <button class="btn btn-sm btn-primary btn-block" type="submit">查询</button>
                </td>
            </tr>
            </thead>
        </table>
    </form>
</div>
<div>
    <table class="table table-striped table-sm">
        <thead>
        <tr>
            <td>奖项名称</td>
            <td>获奖时间</td>
            <td th:if="${#request.getSession().getAttribute('user')} != null">
                <a th:href="@{/awa/add}">添加</a>
            </td>
        </tr>
        </thead>
        <tbody>
        <tr th:each="awa:${awas}">
            <td th:text="${awa.getName()}"></td>
            <td th:text=" ${#dates.format(awa.getTime(), 'yyyy-MM-dd')}"></td>
            <td th:if="${#request.getSession().getAttribute('user')} != null">
                <a class="aButton" th:href="@{/awa/update/{id}(id=${awa.getId()})}">编辑</a>
                <a class="aButton" th:href="@{/awa/delete/{id}(id=${awa.getId()})}">删除</a>
            </td>
        </tr>
        </tbody>
    </table>
</div>
</body>
</html>